home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Genie / Projects / V3DDemo / Source / Sources / V3DDemoMain.cc < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-24  |  1.0 KB  |  62 lines

  1. /*    ==============
  2.  *    V3DDemoMain.cc
  3.  *    ==============
  4.  */
  5.  
  6. #include "Ped1ObjectDeity.hh"
  7. #include "Ped1AppProcess.hh"
  8. #include "PedApplication.hh"
  9. #include "V3DDocModel.hh"
  10. #include "V3DAgentDoc.hh"
  11. #include "V3DHandlerOpenDoc.hh"
  12.  
  13.  
  14. class V3DClassAgent : public PedClassAgent {
  15. public:
  16.     V3DClassAgent(PedTask *inPrimaryTask) : PedClassAgent(inPrimaryTask) {}
  17.     virtual PedAgent *MakeAgent();
  18. };
  19.  
  20. PedAgent *
  21. V3DClassAgent::MakeAgent()
  22. {
  23.     //PedAgent *agent = new PedAgent(mPrimaryTask);
  24.     V3DDocModel *doc = new V3DDocModel();
  25.     PedAgent *agent = new V3DAgentDoc(mPrimaryTask, doc);
  26.     doc->release();
  27.     agent->autorelease();
  28.     
  29.     return agent;
  30. }
  31.  
  32. /*
  33. PedObject *MakeAgent();
  34. PedObject *MakeAgent()
  35. {
  36.     V3DDocModel *agent = new V3DDocModel();
  37.     agent->autorelease();
  38.     return agent;
  39. }
  40. */
  41.  
  42. int main(void)
  43. {
  44.     Ped1AppProcess aProcess;
  45.     
  46.     aProcess.Init();
  47.     
  48.     //gOD->RegisterFabricator('Agnt', &MakeAgent);
  49.     
  50.     PedApplication app;
  51.     
  52.     V3DClassAgent agentClass(&app);
  53.     
  54.     gOD->RegisterAgentClass(&agentClass);
  55.     
  56.     new V3DHandlerOpenDoc(app);
  57.     
  58.     aProcess.Call(app);
  59.     
  60.     return 0;
  61. }
  62.